package com.shop.mms_client.ui;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

public class MessagesPagerAdapter extends FragmentStateAdapter {
    private static final int PAGE_COUNT = 3;

    public MessagesPagerAdapter(FragmentActivity activity) {
        super(activity);
    }

    @Override
    public Fragment createFragment(int position) {
        switch (position) {
            case 0:
                return new AllMessagesFragment();
            case 1:
                return new SpamMessagesFragment();
            case 2:
                return new BlacklistFragment();
            default:
                throw new IllegalArgumentException("Invalid position: " + position);
        }
    }

    @Override
    public int getItemCount() {
        return PAGE_COUNT;
    }
} 